# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-avy
pkgver=0.5.0_git20230420
_gitrev=be612110cb116a38b8603df367942e2bb3d9bdbe
pkgrel=0
_pkgreal=avy
pkgdesc="Jump to things in Emacs tree-style"
url="https://github.com/abo-abo/avy"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="https://github.com/abo-abo/avy/archive/$_gitrev/emacs-avy-$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . \
		-l avy-test -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 avy.el avy.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
4c83c598f39267f1508923ed0fbbf4ae0161768895ce02367ef98c651f17f0fd71edc118c517380e95265a7151bbb52708b82521647cdde6f3c072498bbe2972  emacs-avy-be612110cb116a38b8603df367942e2bb3d9bdbe.tar.gz
"
